package com.atguigu.gulimall.order.service;

import com.atguigu.gulimall.order.ao.OrderSubmitAo;
import com.atguigu.gulimall.order.vo.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.order.entity.OrderEntity;

import java.util.Map;

/**
 * 订单
 *
 * @author dcj
 * @email dcj@gmail.com
 * @date 2023-10-31 21:09:17
 */
public interface OrderService extends IService<OrderEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 确认订单
     * @return ConfirmVo
     */
    ConfirmVo confirmOrder();

    /**
     * 提交订单
     * @return SubmitOrderResponseVo
     */
    SubmitOrderResponseVo submitOrder(OrderSubmitAo ao);

    /**
     * 获取运费
     * @param addrId
     * @return OderFareVo
     */
    OderFareVo getFare(Long addrId);


    /**
     * 获取订单状态
     * @param orderSn
     * @return OrderEntity
     */
    OrderEntity getOrderStatus(String orderSn);


    /**
     * 关闭订单
     * @param order
     */
    void closeOrder(OrderEntity order);

    /**
     * 支付宝支付
     * @return PayVo
     */
    PayVo getOrderPay(String orderSn);

    /**
     * 查询用户所有订单信息
     * @param params
     * @return PageUtils
     */
    PageUtils queryPageWithItem(Map<String, Object> params);

    /**
     * 支付宝异步回调
     * @param payAsyncVo
     * @return String
     */
    String handlePayResult(PayAsyncVo payAsyncVo);
}

